<%@page import="org.jeecgframework.web.util.StaticValue"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
	<div region="center" style="padding:1px;">
		<t:datagrid name="zyTpInspectionPlanList" checkbox="true" fitColumns="false" title="巡检任务"
			actionUrl="zyInspectionPlanController.do?datagridOfAssignEnginner" idField="id" fit="true" queryMode="group">
			<t:dgCol title="主键"			field="id"  	hidden="true"	queryMode="single"  width="120" />
			<t:dgCol title="巡检计划ID"		field="planId"    								queryMode="single"  query="true" url="zyInspectionPlanController.do?detailsOfTpPlan&id={id}" funname="planDetials" width="100" />
			<t:dgCol title="巡检计划状态"		field="state"									queryMode="single"	query="true"	dictionary="<%=StaticValue.DIC_PLAN_STATE %>" width="105" />
			<t:dgCol title="设备SN"			field="equipmentSpare.sn"    					queryMode="single"	query="true"	width="90" />
			<t:dgCol title="巡检计划备注"		field="remarks"    								width="120" sortable="false" />
			<t:dgCol title="影院名称"		field="equipmentSpare.zyCinema.name"			queryMode="single"  query="true"	width="170" sortable="false" />
			<t:dgCol title="影院巡检联系人"	field="zyCmIpCt.name"							width="100"		sortable="false" />
			<t:dgCol title="联系人电话1"		field="zyCmIpCt.cellphone1"						width="95"		sortable="false" />
			<t:dgCol title="联系人电话2"		field="zyCmIpCt.cellphone2"						width="95"		sortable="false" />
			<t:dgCol title="光路"			field="lightPath"			width="60"	sortable="false" dictionary="<%=StaticValue.DIC_LIGHT_PATH %>" />
			<t:dgCol title="去年巡检日期"		field="equipmentSpare.lastYearInspectionDate"	width="100"		formatter="yyyy-MM-dd" />
			<t:dgCol title="计划巡检月份"		field="ipPlanDate"								width="150"	sortable="false" formatter="yyyy年-MM月" query="true" queryMode="group"/>
			<t:dgCol title="预约上门时间"		field="engineerOrderTime"						width="100"		formatter="yyyy-MM-dd" />
			<t:dgCol title="工程师"			field="engineer.name"							query="true" queryMode="single" width="100"	sortable="false" />
			<t:dgCol title="省市"			field="tsTerritoryVal"							width="100"	sortable="false" />
			<t:dgCol title="省市"			field="equipmentSpare.tsTerritory.territoryName"	hidden="true"	queryMode="single"  query="true" sortable="false" />
			<t:dgCol title="影院地址"		field="equipmentSpare.zyCinema.address"			width="370"	sortable="false" />
			<t:dgCol title="是否可以操作"		field="operationAble" hidden="true" width="10" />
			<t:dgCol title="是否可以转派"		field="turnToSend" hidden="true" width="10" />

			<t:dgCol title="操作" field="opt" width="100"></t:dgCol>
			<t:dgFunOpt funname="assginEngineerInCol(id)" title="派单" exp="operationAble#eq#1"></t:dgFunOpt>
			<t:dgFunOpt funname="assginEngineerInCols(id)" title="转派" exp="turnToSend#eq#1"></t:dgFunOpt>
			<t:dgToolBar title="批量分派" icon="icon-add" url="" funname="sendPlanInToolBar"></t:dgToolBar>
			<t:dgToolBar title="批量拒绝" icon="icon-add" url="" funname="refusePlanInToolBar"></t:dgToolBar>
			<t:dgToolBar title="导出" icon="icon-putout" url="" funname="exportIp"></t:dgToolBar>
		</t:datagrid>
	</div>
</div>
<script type="text/javascript">
$(function(){
	$("#zyTpInspectionPlanListtb").find("input[name='actualDate_begin']").attr({"class":"Wdate","id":"actualDate_begin","style":"height:20px;width:90px;"}).click(function(){
		WdatePicker({dateFmt:'yyyy-MM-dd',maxDate:'#F{$dp.$D(\'actualDate_end\')}'});
		});
	$("#zyTpInspectionPlanListtb").find("input[name='actualDate_end']").attr({"class":"Wdate","id":"actualDate_end","style":"height:20px;width:90px;"}).click(function(){
		WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'#F{$dp.$D(\'actualDate_begin\')}'});
		});
	$("#zyTpInspectionPlanListtb").find("input[name='ipPlanDate_begin']").attr({"class":"Wdate","id":"ipPlanDate_begin","style":"height:20px;width:90px;"}).click(function(){
		WdatePicker({dateFmt:'yyyy-MM',maxDate:'#F{$dp.$D(\'ipPlanDate_end\')}'});
		});
	$("#zyTpInspectionPlanListtb").find("input[name='ipPlanDate_end']").attr({"class":"Wdate","id":"ipPlanDate_end","style":"height:20px;width:90px;"}).click(function(){
		WdatePicker({dateFmt:'yyyy-MM',minDate:'#F{$dp.$D(\'ipPlanDate_begin\')}'});
		});
	
	territoryLink('zyTpInspectionPlanList','equipmentSpare.tsTerritory.territoryName',1);
	$.ajax({
		url : "zyCommonController.do?queryCurrtDepartEngineer",
		cache : false,
		dataType : 'json',
		type : 'POST',
		success : function(data){
			if(data.success){
				var egCondtionHtml = '<select style="width:104px;" name="engineer.name" id="engineer_name">' +
										'<option value="">---请选择---</option>';
				$(data.obj).each(function(i, item){
					egCondtionHtml += '<option value="'+ item.egName +'">' + item.egName + '</option>';
				});
				egCondtionHtml += '</select>';
				$("#engineer_name").after(egCondtionHtml).remove();
			}
		}
	});
});
</script>
<script type="text/javascript" src="webpage/com/zybk/zy_inspection_plan/zyThirdPartyAssignEngineer.js"></script>